<!DOCTYPE html>
<html>
<head>
    <title>鹿鹿泽健身工作室教练工作台</title>
    <link rel="stylesheet" href="../static/css/minghu.css">
    <link rel="icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body style="background-color:#fffbf6">

    {% include 'show_ins_info.html' %}

    <div id="index-container">
        <div id="date" style="display:flex;flex-direction:column;align-items:center;text-align:center;color:rgb(240, 168, 60); font-size:20px; margin-bottom: 20px;"></div>
        <div id="insJobStat"></div>
        <div><button id="shiftBoardBtn" onclick="shiftBoard();">关闭会员信息提示</button></div>
        <div id="board" style="background-color: #fafafa;width:100%;margin-bottom: 20px;padding-top:20px;">
            <div id="afterDueDate"></div>
            <div id="birthdayCusList"></div>
            <div id="thisMonthDueCusList"></div>
            <div id="clsMsg"></div>
            <div id="cusTrainInfo"></div>
            <div id="nineYuanClsInfo"></div>
            <div id="activitySendInfo"></div>
        </div>
        
        
        <div>
            <div id='cls' class="form-row"  style="flex-wrap:wrap;gap: 10px;margin-bottom: 30px;">
                <div style="display:flex;width:100%;justify-content:center;"><div class="index-title">上课</div></div>
                <hr style="width:96%;margin-top:1px;margin-bottom:1px;">
                <div id='cusBook' class='cover-button' style="border:1px solid #feece3; background-color:#feece3;">
                    <a href="./ins_book" style="color:rgb(158, 121, 99);">会员预约排课</a>
                </div>

                <div id='formalClsRec' class='cover-button' style="border:1px solid #feece3; background-color:#feece3;">
                    <a href="./cus_cls_input" style="color:rgb(221, 89, 49);">私教课上课录入</a>
                </div>

                <div id='groupClassRec' class='cover-button' style="border:1px solid #feece3; background-color:#feece3;">
                    <a href="./group_class_input" style="color:rgb(221, 89, 49);">小团课上课录入</a>
                </div>
            
                <div id='bodyRec' class='cover-button' style="border:1px solid #fce3fa; background-color:#fce3fa;">
                    <a href="./input_body" style="color:rgb(168, 79, 134);font-size:13px;">会员体测及训练计划录入</a>
                </div>       

                <div id='trialClsRec' class='cover-button' style="border:1px solid #feece3; background-color:#feece3;">
                <a href="./trial_class" style="color:rgb(177, 141, 130);">体验课上课</a>
                </div>
            </div>

            <div id='query' class="form-row"  style="flex-wrap: wrap;gap: 10px; margin-bottom: 30px;">
                <div style="display:flex;width:100%;justify-content:center;"><div class="index-title">查询</div></div>
                <hr style="width:96%;margin-top:1px;margin-bottom:1px;">                

                <div id='bodyData' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_body_data" style="color:rgb(60, 120, 60);">会员报告查询</a>
                </div> 

                <div id='showPlan' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_plan" style="color:rgb(60, 120, 60);">查看会员训练计划</a>
                </div> 

                <div id='showBuyRec' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_cus_buyrec_lmtrec" style="color:rgb(60, 120, 60);">会员购课及开课查询</a>
                </div> 

                <div id='clsDetail' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_cus_train_bydate" style="color:rgb(60, 120, 60);">会员上课训练项目查询</a>
                </div>

                <div id='showCusCalendar' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_cus_calendar" style="color:rgb(60, 120, 60);">会员上课打卡日历</a>
                </div>

                <div id='showVc' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_vc" style="color:rgb(60, 120, 60);">查询会员优惠券</a>
                </div>

                <div id='showCusInfo' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_cus_info" style="color:rgb(60, 120, 60);">会员信息综合查询</a>
                </div> 

                <div id='showCusRewardPoints' class='cover-button' style="border:1px solid #cfeebe; background-color:#cfeebe;">
                    <a href="./show_cus_reward_points" style="color:rgb(60, 120, 60);">会员积分查询</a>
                </div> 
            </div>

            <div  id='manage'  class="form-row"  style="flex-wrap: wrap;gap: 10px;margin-bottom: 30px;">
                <div style="display:flex;width:100%;justify-content:center;"><div class="index-title"  style="width:140px;">会员及课程管理</div></div>
                <hr style="width:96%;margin-top:1px;margin-bottom:1px;">
                <div id='newCus' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./new_cus" style="color:rgb(41, 95, 145);">新增会员</a>
                </div>

                <div id='cusBuy' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./input_buy" style="color:rgb(41, 95, 145);">会员购课</a>
                </div>
            
                <div id='lmtStart' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./start_limit_class" style="color:rgb(41, 95, 145);">限时课程开课</a>
                </div> 

                <div id='setVc' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./set_vc" style="color:rgb(41, 95, 145);">生成会员优惠券</a>
                </div> 

                <div id='editPassDue' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./edit_pass_due_card" style="color:rgb(41, 95, 145);">失效限时课程延期</a>
                </div> 

                <div id='transferCls' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./transfer_cls_type" style="color:rgb(41, 95, 145);">转换课程</a>
                </div> 
                <div id='adminMenu' class='cover-button' style="border:1px solid #c8f1fc; background-color:#c8f1fc;">
                    <a href="./admin" style="color:rgb(41, 95, 145);">管理员菜单</a>
                </div> 
            </div>

            <div  id='data'  class="form-row"  style="flex-wrap: wrap;gap: 10px;margin-bottom: 30px;">
                <div style="display:flex;width:100%;justify-content:center;"><div class="index-title">数据</div></div>
                <hr style="width:96%;margin-top:1px;margin-bottom:1px;">
                <div id='showBusiness' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_business" style="color:rgb(255, 255, 255);">运营数据 / 营收日历</a>
                </div> 
                <div id='showInsClsChart' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_ins_cls_stat" style="color:rgb(255, 255, 255);">会员 / 教练上课统计</a>
                </div> 
                <div id='showDayClsStat' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_day_cls_stat" style="color:rgb(255, 255, 255);">店面上课情况统计</a>
                </div> 
                <div id='showLmt15' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_lmt15_info" style="color:rgb(255, 255, 255);">新人首单15节返现统计</a>
                </div> 
                <div id='continueBuyOver12' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_continue_buy_list" style="color:rgb(255,255,255);">连续购课清单</a>
                </div>  
                <!-- <div id='9.9ClsDueData' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_9point9_due_page" style="color:rgb(255,255,255);">9.9元课程上课情况</a>
                </div>   -->
                <div id='thisMonthDueList' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_this_due_cus_list" style="color:rgb(255, 255, 255);font-size:13px;">本月到期限时课程会员清单</a>
                </div> 
                <div id='afterDueCusList' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_all_after_due_cus" style="color:rgb(255, 255, 255);">待续课会员清单</a>
                </div> 
                <div id='showCusImg' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_cus_img" style="color:rgb(255, 255, 255);">全体会员肖像</a>
                </div> 
                <!-- <div id='showCusInfo' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_cus_info" style="color:rgb(255, 255, 255);">会员信息综合查询</a>
                </div>  -->
                <div id='showCusBirthdayList' class='cover-button' style="border:1px solid #d69244; background-color:#d67b12;">
                    <a href="./show_cus_birthday_list" style="color:rgb(255, 255, 255);">每月生日会员清单</a>
                </div>              
                
                <div id='updateTrainItem' class='cover-button' style="border:1px solid #5e639a; background-color:#2e3284;">
                    <a href="./update_train_item" style="color:rgb(235, 235, 238);">更新训练项目</a>
                </div> 
                <div id='uploadCusImg' class='cover-button' style="border:1px solid #5e639a; background-color:#2e3284;">
                    <a href="./upload_cus_photo" style="color:rgb(235, 235, 238);">上传会员头像照片</a>
                </div> 
            </div>

            <div  id="tools" class="form-row"  style="flex-wrap: wrap;gap: 10px;margin-bottom: 30px;">
                <div style="display:flex;width:100%;justify-content:center;"><div class="index-title"  style="width:70px;">计算器</div></div>
                <hr style="width:96%;margin-top:1px;margin-bottom:1px;">
                <div id='caloryTakenCal' class='cover-button' style="border:1px solid #71a893; background-color:#f2fcf5;">
                    <a href="./cal_calory" style="color:rgb(57, 187, 133);">热量摄入计算器</a>
                </div> 

                <div id='endDateCal' class='cover-button' style="border:1px solid #71a893; background-color:#f2fcf5;">
                    <a href="./cal_enddate" style="color:rgb(57, 187, 133);">课程结束日计算器</a>
                </div> 
            </div>
            
            <button id="clBox" onclick="clearLocalStorage">清理缓存</button>

        </div>
    </div>
    


    <script src="../static/js/common.js"></script>
    <script src="../static/js/clsMsgAlert.js"></script>
    <script>
        let insId;
        let insName;
        let insRole;
        document.addEventListener('DOMContentLoaded',function(){
            // loginCheck();

            const insInfos=hideInsSelectBlockAndGetInsInfo();
            insId=insInfos['sessionInsId'];
            insName=insInfos['sessionInsName'];
            insRole=insInfos['sessionInsRole'];

            //教练角色不显示某些页面
            const cusBook=document.getElementById('cusBook');
            const newCus=document.getElementById('newCus');
            const cusBuy=document.getElementById('cusBuy');
            const lmtStart=document.getElementById('lmtStart');
            const showBusiness=document.getElementById('showBusiness');
            const updateTrainItem=document.getElementById('updateTrainItem');
            const localStorageDiv=document.getElementById('clBox');
            const showInsClsChart=document.getElementById('showInsClsChart');
            const showLmt15=document.getElementById('showLmt15');
            const showCusImg=document.getElementById('showCusImg');
            // const showCusInfo=document.getElementById('showCusInfo');
            const uploadCusImg=document.getElementById('uploadCusImg');
            const thisMonthDueList=document.getElementById('thisMonthDueList');
            const showCusBirthdayList=document.getElementById('showCusBirthdayList');
            const setVc=document.getElementById('setVc');
            const afterDueCusList=document.getElementById('afterDueCusList');
            const editPassDue=document.getElementById('editPassDue');
            const continueBuyOver12=document.getElementById('continueBuyOver12');
            const transferCls=document.getElementById('transferCls');
            const showDayClsStat=document.getElementById('showDayClsStat');
            const show9point9Due=document.getElementById('9.9ClsDueData');
            const groupClassRec=document.getElementById('groupClassRec');
            const adminMenu=document.getElementById('adminMenu');
            const showCusRewardPoints=document.getElementById('showCusRewardPoints');


            //菜单块
            const data=document.getElementById('data');

            console.log('ins role:',insRole)

            if(insRole==='ins'){
                // newCus.style.display='none';
                cusBuy.style.display='none';
                lmtStart.style.display='none';
                cusBook.style.display='none';
                showBusiness.style.display='none';
                updateTrainItem.style.display='none';
                data.style.display='none';
                localStorageDiv.style.display='none';
                showInsClsChart.style.display='none';
                showLmt15.style.display='none';
                showCusImg.style.display='none';
                // showCusInfo.style.display='none';
                uploadCusImg.style.display='none';
                thisMonthDueList.style.display='none';
                showCusBirthdayList.style.display='none';
                setVc.style.display='none';
                afterDueCusList.style.display='none';
                editPassDue.style.display='none';
                continueBuyOver12.style.display='none';
                transferCls.style.display='none';
                showDayClsStat.style.display='none';
                adminMenu.style.display='none';
                // show9point9Due.style.display='none';
                //特殊，开放给LZINS002
                if(insId==='LZINS002'){
                    data.style.display='flex';
                    updateTrainItem.style.display='flex';
                }
            }else{
                // newCus.style.display='flex';
                cusBuy.style.display='flex';
                lmtStart.style.display='flex';
                cusBook.style.display='flex';
                showBusiness.style.display='flex';
                updateTrainItem.style.display='flex';
                data.style.display='flex';                
                showInsClsChart.style.display='flex';
                showLmt15.style.display='flex';
                showCusImg.style.display='flex';
                // showCusInfo.style.display='flex';
                uploadCusImg.style.display='flex';
                thisMonthDueList.style.display='flex';
                showCusBirthdayList.style.display='flex';
                setVc.style.display='flex';
                editPassDue.style.display='none';
                afterDueCusList.style.display='flex';
                continueBuyOver12.style.display='flex';
                transferCls.style.display='flex';
                localStorageDiv.style.display='none';
                showDayClsStat.style.display='flex';
                // show9point9Due.style.display='flex';
                // showCusRewardPoints.style.display='flex';
                if(insId==='LZADM001'){
                    localStorageDiv.style.display='flex';
                    editPassDue.style.display='flex';
                    adminMenu.style.display='flex';
                }
            }

            const goIndexButton=document.getElementById('goIndex');
            goIndexButton.style.display='none';
            const dateBlock=document.getElementById('date');
            const today=new Date();
            const year = today.getFullYear();
            const month = String(today.getMonth() + 1).padStart(2, '0');
            const day = String(today.getDate()).padStart(2, '0');
            // 获取星期几的数值
            const dayOfWeek = today.getDay();
            // 将星期几的数值转换为中文
            let weekDayChinese = '';
            switch (dayOfWeek) {
            case 0:
                weekDayChinese = '星期日';
                break;
            case 1:
                weekDayChinese = '星期一';
                break;
            case 2:
                weekDayChinese = '星期二';
                break;
            case 3:
                weekDayChinese = '星期三';
                break;
            case 4:
                weekDayChinese = '星期四';
                break;
            case 5:
                weekDayChinese = '星期五';
                break;
            case 6:
                weekDayChinese = '星期六';
                break;
            default:
                weekDayChinese = '未知';
            }
            dateDisplay=`${year}年${month}月${day}日    ${weekDayChinese}`; 
            dateBlock.innerText=dateDisplay;
        
            // hideInsSelectBlockAndGetInsInfo();
            getCusTrainInfo();

            //获取30天15节限时课程信息
            indexMsgAlert();
            //获取教练业绩等统计信息
            showInsJob();
            //显示当月到期会员名单
            showThisMonthDueCusList();
            //显示本月生日的会员名单
            showThisMonthBirthdayCus();
            //显示到期课程会员名单
            showDueData();
            //显示9.9元课程信息
            // show9Point9ClsInfo();
            //显示活动赠课信息
            //显示活动赠课信息
            // showActivitySendCls();

            document.getElementById('clBox').addEventListener('click',clearLocalStorage);
        
        });

        function shiftBoard(){
            const shiftBoardBtn=document.getElementById('shiftBoardBtn');
            const board=document.getElementById('board');
            if(board.style.display!=='none'){
                shiftBoardBtn.textContent='显示会员信息提示';
                board.style.display='none';
                shiftBoardBtn.style.marginBottom='20px';
            }else{
                shiftBoardBtn.textContent='关闭会员信息提示';
                board.style.display='block';
                shiftBoardBtn.style.marginBottom='5px';
            }
        }

       
        function clearLocalStorage(){
            const regex1 = /^LZ(ADM|INS)\d{3}$/;
            const regex2= /^LZ\d{5}/;

            const insCusList=[...new Set(
                Object.keys(localStorage)
                .filter(key=>{
                        const keySplit=key.split('-');
                        return keySplit[0].match(regex1) && keySplit[1].match(regex2);
                    }
                )
                .map(key=>{
                    return `${key.split('-')[0]}-${key.split('-')[1]}`;
                })

            )];          

            let clsNum=0;
            insCusList.forEach(incCusId=>{
                const isConfirmed=confirm(`${incCusId} 有缓存记录，是否清除？`)
                if(isConfirmed){
                    Object.keys(localStorage).forEach(key=>{
                        const keySplit=key.split('-');                        
                        if(keySplit[1]===incCusId.split('-')[1]){
                            localStorage.removeItem(key)
                            clsNum+=1;
                        }
                    });
                }
            });

            if(clsNum>0){
                alert('缓存数据已清理。')
            }

            
        }
        

        function getCusTrainInfo(){
            let insIdPage;
            if(insRole==='ins'){
                insIdPage=insId;
            }else{
                //特殊，陆的情况
                if(insRole==='admin'){
                    if(insId==='LZADM002'){
                        insIdPage='LZINS001';
                    }
                    
                }
            }

            if(insIdPage){
                fetch('/get_latest_cus_train_days',{
                    method:"POST",
                    headers:{
                        "Content-Type":"application/json"
                    },
                    body: JSON.stringify({'insId':insIdPage})
                })
                .then(response=>response.json())
                .then(data=>{
                    // console.log('cus train days:',data)
                    if(data['res']==='ok'){
                        showCusInfo(data['data']);

                    }
                })
                .catch(error=>{
                    console.log(error)
                });

            }            
        }

        function showCusInfo(data){
            // const divInsTitle=document.createElement('div');
            // // divInsTitle.innerHTML=`<span style='color:#7c899c;font-size:13px;'>—  ${insName}教练</span>`;
            // divInsTitle.style.width='100%';
            // divInsTitle.innerHTML=''
            // divInsTitle.style.marginTop='20px';
            // // divInsTitle.style.color='#5574a3';
            // divInsTitle.style.fontWeight='bold';

            const cusTrainInfoBox=document.getElementById('cusTrainInfo');
            cusTrainInfoBox.style.width='100%';
            cusTrainInfoBox.style.margin='0px';
            cusTrainInfoBox.style.padding='0px';
            cusTrainInfoBox.innerHTML='';

            const divTitle=document.createElement('div');
            divTitle.innerHTML=`<div style="background-color:#2566cf;color:#ffffff;width:100%;">会员上课情况</div>`;
            // divTitle.style.marginTop='10px';
            divTitle.style.color='#647392';
            divTitle.style.width='100%';
            divTitle.style.fontSize='12px';
            divTitle.style.textAlign='center';
            divTitle.style.marginBottom='10px';
            cusTrainInfoBox.sy
            const hr=document.createElement('hr');
           
            cusTrainInfoBox.appendChild(divTitle);
            // cusTrainInfoBox.appendChild(hr);


            let cusNotStartStr='';
            let cusIn7DaysStr='';
            let cusIn7to30DaysStr='';
            let cusOver30DaysStr='';

            let notStartCount=0;
            let in7DaysCount=0;
            let in7To30DaysCount=0;
            let over30DaysCount=0;

            data.forEach(item => {
                if(item[3]==='-'){                    
                    cusNotStartStr=cusNotStartStr+item[1]+',';
                    notStartCount+=1;
                }else{
                    if(parseFloat(item[3])<=7){
                        cusIn7DaysStr+=item[1]+',';
                        in7DaysCount+=1;
                    }else if(parseFloat(item[3])<=30){
                        cusIn7to30DaysStr+=item[1]+',';
                        in7To30DaysCount+=1;
                    }else{
                        cusOver30DaysStr+=item[1]+',';
                        over30DaysCount+=1;
                    }

                }
            });            

            const totalCusCount=notStartCount+in7DaysCount+in7To30DaysCount+over30DaysCount;



            cusNotStartStr=cusNotStartStr.slice(0,-1);
            cusIn7DaysStr=cusIn7DaysStr.slice(0,-1);
            cusIn7to30DaysStr=cusIn7to30DaysStr.slice(0,-1);
            cusOver30DaysStr=cusOver30DaysStr.slice(0,-1);

            // console.log(cusNotStartStr,cusIn7DaysStr,cusIn7to30DaysStr,cusOver30DaysStr);

            if(cusNotStartStr){
                const divBox=document.createElement('div');
                divBox.classList.add('index-small-div');
                const divTitleBox=document.createElement('div');
                divTitleBox.classList.add('show-ins-cls_stat-cus-title');

                const divTitle=document.createElement('div');
                divTitle.style.backgroundColor='#3ab559';
                divTitle.textContent='还没开始上课的会员';
                divTitle.classList.add('index-small-title');

                const divCount=document.createElement('div');
                divCount.innerHTML=`${notStartCount}人`;
                divCount.classList.add('show-ins-cls-stat-count-box');
                divCount.style.color='#3ab559';

                divTitleBox.appendChild(divTitle);
                divTitleBox.appendChild(divCount);


                const divContent=document.createElement('div');
                divContent.textContent=cusNotStartStr;
                divContent.classList.add('index-small-content');
                divBox.appendChild(divTitleBox);
                divBox.appendChild(divContent);
                cusTrainInfoBox.appendChild(divBox);
            }

            if(cusIn7DaysStr){               
                const divBox=document.createElement('div');
                divBox.classList.add('index-small-div');                
                const divTitleBox=document.createElement('div');
                divTitleBox.classList.add('show-ins-cls_stat-cus-title');
                
                const divTitle=document.createElement('div');
                divTitle.style.backgroundColor='#2b62ed';
                divTitle.textContent='最近7天在训练的会员';
                divTitle.classList.add('index-small-title');

                const divCount=document.createElement('div');
                divCount.innerHTML=`${in7DaysCount}人`;
                divCount.classList.add('show-ins-cls-stat-count-box');
                divCount.style.color='#2b62ed';

                divTitleBox.appendChild(divTitle);
                divTitleBox.appendChild(divCount);

                const divContent=document.createElement('div');
                divContent.textContent=cusIn7DaysStr;
                divContent.classList.add('index-small-content');
                divBox.appendChild(divTitleBox);
                divBox.appendChild(divContent);
                cusTrainInfoBox.appendChild(divBox);
            }

            if(cusIn7to30DaysStr){
                
                const divBox=document.createElement('div');
                divBox.classList.add('index-small-div');                
                const divTitleBox=document.createElement('div');
                divTitleBox.classList.add('show-ins-cls_stat-cus-title');
                
                const divTitle=document.createElement('div');
                divTitle.style.backgroundColor='#2f53ad';
                divTitle.textContent='7-30天内在训练的会员';
                divTitle.classList.add('index-small-title');

                const divCount=document.createElement('div');
                divCount.innerHTML=`${in7To30DaysCount}人`;
                divCount.classList.add('show-ins-cls-stat-count-box');
                divCount.style.color='#2f53ad';

                divTitleBox.appendChild(divTitle);
                divTitleBox.appendChild(divCount);

                const divContent=document.createElement('div');
                divContent.textContent=cusIn7to30DaysStr;
                divContent.classList.add('index-small-content');
                divBox.appendChild(divTitleBox);
                divBox.appendChild(divContent);
                cusTrainInfoBox.appendChild(divBox);
            }

            if(cusOver30DaysStr){   
                const divBox=document.createElement('div');
                divBox.classList.add('index-small-div');                
                const divTitleBox=document.createElement('div');
                divTitleBox.classList.add('show-ins-cls_stat-cus-title');
                
                const divTitle=document.createElement('div');
                divTitle.style.backgroundColor='#f55b49';
                divTitle.textContent='超过30天没有训练的会员';
                divTitle.classList.add('index-small-title');

                const divCount=document.createElement('div');
                divCount.innerHTML=`${over30DaysCount}人`;
                divCount.classList.add('show-ins-cls-stat-count-box');
                divCount.style.color='#f55b49';

                divTitleBox.appendChild(divTitle);
                divTitleBox.appendChild(divCount);

                const divContent=document.createElement('div');
                divContent.textContent=cusOver30DaysStr;
                divContent.classList.add('index-small-content');
                divBox.appendChild(divTitleBox);
                divBox.appendChild(divContent);
                cusTrainInfoBox.appendChild(divBox);
            }

            cusTrainInfoBox.classList.add('index-cus-train-box');
            // divInsTitle.innerHTML=`<span style='color:#7c899c;font-size:13px;'>—  ${insName}教练</span>&nbsp;&nbsp;&nbsp; <span style='font-size:12px;'>共有会员 ${totalCusCount} 人</span>`;
            
            


        }

    </script>
</body>